{template '_header'}

<div class="page-heading">
    {ifp 'diypage.menu.add'}
        <span class="pull-right">
            <a class="btn btn-default btn-sm" href="{php echo webUrl('diypage/menu/add')}">新建菜单</a>
        </span>
    {/if}
	<h2><i class="fa fa-circle-o"></i>自定义菜单管理 <small>总数({$total})</small></h2>
</div>

<form action="" method="post">
    <div class="page-toolbar row m-b-sm m-t-sm">
        <div class="col-sm-4">
            <div class="input-group-btn">
                <span class="btn btn-default btn-sm" type="button" data-toggle="refresh"><i class="fa fa-refresh"></i></span>
                {ifp 'diypage.menu.delete'}
                    <button class="btn btn-default btn-sm" type="button" data-toggle="batch-remove" data-confirm="确认要删除?" data-href="{php echo webUrl('diypage/menu/delete')}" disabled="disabled"><i class="fa fa-trash"></i> 删除</button>
                {/if}
            </div>
        </div>

        <div class="col-sm-6 pull-right">
            <div class="input-group">
                <input type="text" class="input-sm form-control" name="keyword" value="{$_GPC['keyword']}" placeholder="请输入页面标题或关键字进行搜索">
                <span class="input-group-btn">
                    <button class="btn btn-sm btn-primary" type="submit"> 搜索</button>
                </span>
            </div>

        </div>
    </div>

    {if empty($list)}
    <div class="panel panel-default">
        <div class="panel-body" style="text-align: center;padding:30px;">
            未查询到{if !empty($_GPC['keyword'])}"{$_GPC['keyword']}"{/if}相关菜单!
        </div>
    </div>
    {else}
        <table class="table table-hover table-responsive">
            <thead>
            <tr>
                <th style="width:25px;"><input type="checkbox"></th>
                <th>菜单名称</th>
                <th style="width: 100px;">创建时间</th>
                <th style="width: 100px;">最后修改时间</th>
                <th style="width: 160px">操作</th>
            </tr>
            </thead>
            <tbody>
                {loop $list $item}
                    <tr>
                        <td>
                            <input type="checkbox" value="{$item['id']}">
                        </td>
                        <td>{$item['name']}</td>
                        <td>{php echo date('Y-m-d', $item['createtime'])}<br>{php echo date('H:i:s', $item['createtime'])}</td>
                        <td>{php echo date('Y-m-d', $item['lastedittime'])}<br>{php echo date('H:i:s', $item['lastedittime'])}</td>
                        <td>
                            {ifp 'diypage.menu.edit'}
                                <a class="btn btn-default btn-sm" href="{php echo webUrl('diypage/menu/edit', array('id'=>$item['id']))}"><i class="fa fa-edit"></i>  编辑</a>
                            {/if}
                            {ifp 'diypage.menu.delete'}
                                <a class="btn btn-default btn-sm" data-toggle="ajaxRemove" href="{php echo webUrl('diypage/menu/delete', array('id'=>$item['id']))}" data-confirm="确定要删除该菜单吗？"><i class="fa fa-remove"></i> 删除</a>
                            {/if}
                        </td>
                    </tr>
                {/loop}
            </tbody>
        </table>
        {$pager}
    {/if}

</form>

{template '_footer'}